#!D:\Python27\python
# Filename:backup_ver1.py

import os
import time

source = ['E:\\pytest','F:\\360Downloads']
target_dir = 'F:\\backfile\\'
target = target_dir + time.strftime('%Y%m%d%H%M%S')+'.rar'
rar_cmd = "rar a %s %s"%(target,' '.join(source))

if os.system(rar_cmd) == 0:
    print 'Successful backup to',target
else:
    print 'Backup FAILED'
